<?php

$output = array(
    "success" => $success,
    "newTags" => array(),
    "feedbackTags" => array()
);

foreach($newTags as $newTag) {
    $output["newTags"][] = array(
        "id" => $newTag->getId(),
        "name" => $newTag->getName(),
    );
}

foreach($feedbackTags as $feedbackTag) {
    $output["feedbackTags"][] = $feedbackTag;
}

echo json_encode($output);
